package cn.hxzy.controller;


import cn.hxzy.common.Result;
import cn.hxzy.entity.carteam.VehicleInformation;
import cn.hxzy.service.VehicleInformationService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hk
 * @since 2023-06-23
 */
@CrossOrigin
@RestController
@RequestMapping("/vehicleInformation")
public class VehicleInformationController {

    @Autowired
    private VehicleInformationService vehicleInformationService;

    /**
     * 通过车辆编号查询车辆
     * @param carId
     * @return
     */
    @GetMapping("/selectCarById/{carNum}")
    public Result selectCarById(@PathVariable String carNum) {
        VehicleInformation information = vehicleInformationService.selectCarById(carNum);
        if (information != null) return Result.ok().message("查询车辆对象成功").data1(information);
        return Result.error().message("查询车辆对象失败");
    }
//    @GetMapping("/plateNumber/{licensePlateNumber}")
//   public Result getCarType(@PathVariable  String licensePlateNumber){
//     return vehicleInformationService.getCarType(licensePlateNumber);
//    }

}

